/*
 * mox_log.h
 *
 *  Created on: Jun 10, 2010
 *      Author: Jason Monk
 */

#ifndef MOX_LOG_H_
#define MOX_LOG_H_

#include "mox.h"
#include "mox_slave.h"
#include "mox_module.h"

#ifndef __XC__
#include <xccompat.h>
#endif

/*
typedef enum {
	LOG_MESSAGE=0x300,
	LOG_END,
	LOG_ACK,
	LOG_NACK,
	LOG_REQ_ADD
} log_msg_t;
*/

#define LOGGER_CORE 0

#define INT_SUPPORT

struct system_log {
	uchanend channel;
	unsigned core_id;
};

int module_log(chanend mox, const char format[], ...);
int sprint_log(int REF(p), chanend log);
void sprint_int(char string[], unsigned REF(string_index), int val, int signed_fl);
void sprint_hex(char string[], unsigned REF(string_index), unsigned val);

#ifndef __XC__
int master_log(mox_master_state *state, const char format[], ...);
int slave_log(struct mox_slave_state *state, const char format[], ...);
#endif


#endif /* MOX_LOG_H_ */
